package util.android.form.respuesta;

import android.widget.DatePicker;
import util.NumberUtil;

//OnDateChangedListener 
//http://stackoverflow.com/questions/8519800/how-to-set-the-value-of-the-datepicker-in-to-edittext

public class DatePickerInput 
extends AbstractInputAndroid1<DatePicker, DatePickerInput>
{
	public DatePickerInput(DatePicker dp) {
		super(dp);        
		dp.setCalendarViewShown(false);
	}

	//http://stackoverflow.com/questions/14851285/how-to-get-datepicker-value-in-date-format
	@Override
	public String getValor() {
		StringBuilder sb = new StringBuilder();
		sb.append(NumberUtil.intToString(view.getDayOfMonth(),2));
		sb.append("/");
		sb.append(NumberUtil.intToString(view.getMonth()+1,2));
		sb.append("/");
		sb.append(view.getYear()+"");
		return sb.toString();
	}

	@Override
	public void soloSetValor(String valor) {
		//dp.init(year, monthOfYear, dayOfMonth, onDateChangedListener)
	}

	@Override
	protected void soloLectura(boolean soloLectura) {
		// TODO Auto-generated method stub
		
	}
		

}
